package com.jixiantubu.yueban;

import com.example.jixiantubu.R;
import android.app.Activity;
import android.app.Fragment;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.widget.TextView;

public class TopByYueBanFragment extends Fragment {
	TextView t7;
	ICallBack2 iCallBack2;

	public interface ICallBack2 {
		// title表示传给中间碎片的文本，alg标志是哪个模块传的
		public void danamicLoad2(String title, int flag);

	}

	@Override
	public void onAttach(Activity activity) {
		// TODO Auto-generated method stub
		super.onAttach(activity);
		iCallBack2 = (ICallBack2) activity;
	}

	@Override
	public View onCreateView(LayoutInflater inflater, ViewGroup container,
			Bundle savedInstanceState) {
		View view = inflater.inflate(R.layout.topbarbyyueban, null);
		t7 = (TextView) view.findViewById(R.id.ybdbdaohang);
		setlistener();
		return view;
	}

	private void setlistener() {
		// 监听TextView单击事件
		t7.setOnClickListener(onClickListener);
	}

	OnClickListener onClickListener = new OnClickListener() {

		@Override
		public void onClick(View arg0) {
			switch (arg0.getId()) {
			case R.id.kepu:
				iCallBack2.danamicLoad2("约伴", 3);
				break;
			default:
				break;
			}

		}
	};
}
